package cn.gson.springboot.model.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSONArray;

import cn.gson.springboot.model.dao.DrugPurchaseYkDAO;
import cn.gson.springboot.model.mapper.YaokurukuMapper;
import cn.gson.springboot.model.pojos.DestructionYk;
import cn.gson.springboot.model.pojos.DrugPurchaseYk;

@Service
@Transactional(rollbackFor=Exception.class)
public class YaokurukuService {
	@Autowired
	private YaokurukuMapper rm;
	@Autowired
	private DrugPurchaseYkDAO dpd;
	
	//查询所有
	public JSONArray findAll(Integer purchase_id) {
		return rm.findAll(purchase_id);
	}
	
	//修改
	public DrugPurchaseYk idsh(Integer purchaseId) {
		return dpd.idshe(purchaseId);
	}
	
	//新增
	public DrugPurchaseYk xinzzz(DrugPurchaseYk dp) {
		return dpd.save(dp);
	}
	

} 
